export function fullScreen() {
	let isFull = document.isFullScreen || document.mozIsFullScreen || document.webkitIsFullScreen

	// 判断是否全屏
	if (isFull) {
		let close = document.exitFullscreen || document.webkitCancelFullScreen || document.mozCancelFullScreen || document.msExitFullscreen
		close && close.call(document)
	} else {
		let docElm = document.documentElement
		let open = docElm.requestFullScreen || docElm.webkitRequestFullScreen || docElm.mozRequestFullScreen || docElm.msRequestFullscreen
		open && open.call(docElm)
	}
}

export function viewPhoto($, src, callback) {
	let dom = `<div id="prvewList" style="
	  z-index: 99999999;
	  position: relative;
  "><div><div class="ImageView is-active" style="padding-bottom: 10px;"><div class="ImageView-inner" style="overflow: auto;text-align: center;"><img src="${src}" class="ImageView-img" alt="preview" style="width: 654px; transform: translate3d(0, 204.173px, 0px) scale3d(1.35015, 1.35015, 1); opacity: 1;"></div></div></div></div>`
	$("body").append(dom);
	$("#prvewList").on("click", function () {
		$("#prvewList").remove();
	});
}